import java.util.TreeMap;
public class IdSort {
    public static void main(String[] args) {
        TreeMap<Integer,String> ts = new TreeMap<>((o1, o2)-> o2 - o1);
        ts.put(1,"xiaomi");
        ts.put(2,"Huawei");
        ts.put(3,"oppo");
        ts.put(4,"vivo");
        ts.put(5,"meizu");
        //升序（默认）
//        System.out.println("默认升序");
//        System.out.println(ts);
//        for (String key :ts.keySet()) {
//            System.out.print(key+" "+ts.get(key)+"  ");
//        }
        //降序
        System.out.println("重写降序");
        for (Integer key :ts.keySet()) {
            System.out.print(key+" "+ts.get(key)+"  ");
        }
    }
}
